package com.hm.hall.commons.service.helper;


import com.hm.hall.commons.constans.po.StubInfo;
import com.hm.hall.commons.util.ActionUtils;

/**
 * session;
 */
public class SessionServiceHelper {
    // private static Logger log = Logger.getLogger(SessionServiceHelper.class);


    // 微信公众号用户信息  WeixinSnsapiUserInfoPO
    public static final String WEIXIN_MP_USER_INFO = "WEIXIN_MP_USER_INFO";
    // 用户登录游戏平台后返回信息
    public static final String USER_LOGIN_RESP = "USER_LoginResp";
    public static final String USER_LOGIN_RESP_JSON = "USER_loginRespJSON";
    // 用户进入游戏房间的 StubInfo 信息
    private static final String INTO_GAME_STUB_INFO = "INTO_GAME_STUB_INFO";

    public static String getUserLoginRespJSON() {
        return (String) ActionUtils.getSession().getAttribute(USER_LOGIN_RESP_JSON);
    }


    // *** 进入游戏房间后的 用户的sessionToken

    public static StubInfo getIntoGameStubInfo() {
        return (StubInfo) ActionUtils.getSession().getAttribute(INTO_GAME_STUB_INFO);
    }

    public static void setIntoGameStubInfo(StubInfo data) {
        ActionUtils.getSession().setAttribute(INTO_GAME_STUB_INFO, data);
    }

}
